home *** CD-ROM | disk | FTP | other *** search
/ New Perspectives on Computer Concepts / New Perspectives on Computer Concepts.iso / np2010c / page784.pag < prev    next >
Portable Network Graphic  |  2008-10-02  |  83KB  |  817x1045  |  8-bit (256 colors)
Labels: chat room | computer | hakham | laptop | monitor | reckoner
OCR: 716 SECTION D CHAPTER 1.2 You can ask questions by entering goals from the ? prompt. For example the goal ?- shapeof (pizzal square) means "Is the shape of pizza1 square? Prolog searches through the facts to see if it can satisfy the by finding match. If a match S found, Prolog responds with yes; other- wise, tresponds with no This exercise might seem trivial because you are working with small set facts, which are all visible on the screen. Many programs however, contain hundreds of facts which cannot be displayed on single screen or easily remembered by a programmer Prolog allows you to ask open-ended questions by replacing constants with variables. constant such as pizza square, or 10, represents an unchanging value or attribute In contrast Prolog variable is like place- holder or an emp ...